package nutella89.basic;

public class J13_Q77_Books_OOP {

	public static void main(String[] args) {
		// 도서 관리 시스템 (OOP)
		J13_Book book = 
			new J13_Book( 12345, "누구나 알기 쉬운",
			   "혜지원", "타케시", "스릴러", "22500",
			   false, "2014-06-10");
		
		J13_Book[] books = new J13_Book[5];
		// 대여한 책을 저장하기 위해 배열 선언
		books[0] = book;	// 대여한 책을 배열에 저장 
		
		J13_Member member = new J13_Member
			(98765, "수지", "123-456-789", 
			books , 12345);
		
		// 도서정보 출력
		System.out.println( book.toString() );
		
	} // main

} // class

class J13_Book {
	private int bookno;
	private String bookName;
	private String publisher;
	private String author;
	private String genre;
	private String price;
	private boolean isRent;
	private String regdate;
	
	public J13_Book( int bookno, String bookName,
		String publisher, String author, 
		String genre, String price, 
		boolean isRent,	String regdate) {
		this.bookno = bookno;
		this.bookName = bookName;
		this.publisher = publisher;
		this.author = author;
		this.genre = genre;
		this.price = price;
		this.isRent = isRent;
		this.regdate = regdate;
	}
	
	@Override
	public String toString() {
		String bookInfo = "도서명 : " + bookName;
		bookInfo += "출판사 : " + publisher;
		
		return bookInfo;
	}
	
}

class J13_Member {
	private int memberNo;
	private String name;
	private String telNo;
	/*private J13_Book rbook1;
	private J13_Book rbook2;
	private J13_Book rbook3;
	private J13_Book rbook4;
	private J13_Book rbook5;*/
	private J13_Book[] rbooks;
	private int mileage;
	
	public J13_Member( int memberNo, String name,
			String telNo, J13_Book[] rbooks, 
			int mileage) {
		this.memberNo = memberNo;
		this.name = name;
		this.telNo = telNo;
		this.rbooks = rbooks;
		this.mileage = mileage;
	}
	
}













